home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 276_290 / 282c / Text
Encoding:
Text File  |  1996-01-09  |  37.9 KB  |  950 lines

  1. -----------------------------------------------------------------------------
  2. 8th January 1996
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 282
  6. Issue: 1.0
  7. Author: DW/DNW
  8.  
  9. -----------------------------------------------------------------------------
  10. Writing Command Scripts for Acorn InterTalk
  11. -----------------------------------------------------------------------------
  12. Notes: 
  13. This Application Note details the scripting language supported by InterTalk,
  14. which is used for purposes such as automating the connection and
  15. authentication procedures required at each login by Internet service
  16. providers. Example scripts are given, and the prerequisite services required
  17. are detailed.
  18.  
  19. NB. The details of pppconnect and PPP compatibility apply to InterTalk
  20. version 2.x and later; earlier versions support SLIP only.
  21. -----------------------------------------------------------------------------
  22. Applicable Hardware:  
  23.  
  24. All machines equipped with RISC OS 3.1 or later
  25.  
  26. Related Application Notes: 
  27.  
  28. 234: Peripheral Interfacing via the Serial Port
  29.  
  30. -----------------------------------------------------------------------------
  31. Copyright (C) 1996 Acorn Computers Limited
  32.  
  33. Every effort has been made to ensure that the information in this leaflet is 
  34. true and correct at the time of printing. However, the products described in
  35. this leaflet are subject to continuous development and improvements and
  36. Acorn Computers Limited reserves the right to change its specifications at
  37. any time. Acorn Computers Limited cannot accept liability for any loss or
  38. damage arising from the use of any information or particulars in this
  39. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  40. Limited.
  41. -----------------------------------------------------------------------------
  42. Support Group
  43. Acorn Computers Limited
  44. Acorn House
  45. Vision Park
  46. Histon
  47. Cambridge
  48. CB4 4AE                                                  
  49. -----------------------------------------------------------------------------
  50. Introduction
  51. ------------
  52. One of the most useful facilities to bear in mind when setting up an
  53. InterTalk system is the InterTalk scripting language. This language gives
  54. you the flexibility to configure InterTalk so that it can operate with a
  55. wide range of connection and authentication interfaces used by Internet
  56. service providers, and automate the procedure for connecting your system to
  57. the Internet so that your machine can download your email and USENET News 
  58. at any configured time of day. 
  59.  
  60. This Application Note leads you through a typical script, and contains
  61. further details about IP allocation in InterTalk and InterTalk's
  62. requirements regarding protocols which must be supported by service
  63. providers, in addition to supplying a reference to the InterTalk script
  64. command set.
  65.  
  66. Protocols and Interfaces
  67. ------------------------
  68. Currently, InterTalk is capable of transmitting and receiving IP datagrams
  69. as SLIP packets, PPP packets or "unwrapped" IP packets.
  70.  
  71. SLIP provides a point-to-point connection between two devices for the
  72. transmission of Internet datagrams; the devices can be either two computers,
  73. or a computer and an Internet router. SLIP modifies a standard Internet
  74. datagram by appending a special SLIP END character to it, which allows
  75. datagrams to be distinguished as separate when transmitted serially. 
  76.  
  77. PPP provides a point to point connection also. The advantages PPP has over
  78. SLIP is that it can compress the header information (which contains such
  79. information as the intended destination of the packet), and test the
  80. integrity of inter-system connections, rerouting packets where appropriate.
  81. PPP will also take care of much of the connection configuration, thus making
  82. life easier for Intertalk script authors. 
  83.  
  84. The single "device" which is used to transmit and receive SLIP packets is
  85. the single serial port fitted as standard to your machine; when referenced
  86. by the SLIP driver, this device is referred to as "sl0" (SLIP port 0). This
  87. is currently the only device which InterTalk supports for communication with
  88. the Service Provider when using SLIP.
  89.  
  90. The InterTalk PPP driver supports the "block driver" interface, which has
  91. been available for some time as a Freeware interface specification and
  92. conformant device driver set. This now means that, in addition to the
  93. internal serial port, third party devices such as high-speed dual serial
  94. port cards may be used which enable pre Risc PC machine to exchange data
  95. with a modem at rates > 19200 baud. Whichever physical interface is used,
  96. the PPP driver referes to it as "ppp0" (PPP port 0). 
  97.  
  98. If you have a direct ethernet connection to the Internet (eg via ISDN),
  99. Intertalk can make use of this as well.
  100.  
  101. The use of SLIP or PPP only affects the fundamental IP layer, and is
  102. therefore transparent to the upper-layer protocols; hence service-oriented
  103. protocols such as SMTP (email), NNTP (USENET News), FTP (File Transfer
  104. Protocol) HTTP (World Wide Web) and other equivalent-layer protocols such as
  105. telnet will all work correctly over SLIP or PPP.
  106.  
  107. Other factors to bear in mind are that the configuration of InterTalk is
  108. subtly different depending on whether your provider allocates you a fixed IP
  109. address or has dynamic IP allocation (in which your IP address is determined
  110. as part of each logon procedure), and that the Point of Presence (PoP) you
  111. plan to use supports modem speeds up to the maximum rate supported by your
  112. own modem, subject to the limitations imposed by the serial port (see
  113. Application Note 234 for further details).
  114.  
  115.  
  116. Anatomy of a Logon Script
  117. -------------------------
  118. The following paragraphs provide a line-by-line dissection of a typical
  119. InterTalk logon script. The scripts themselves are stored with the leafname
  120. "Script"  in the directory relevant to the service provider in the
  121. !MailServ.Providers hierarchy; for example, the script for Demon Internet
  122. Services is stored as "!Mailserv.Providers.Demon.Script". The remaining
  123. files in the !Mailserv.<provider> directory contain details of the telephone
  124. numbers of the currently-known Points of Presence (PoPs) used by each
  125. provider.
  126.  
  127. #Demon Internet SLIP
  128. This line is a comment, as it starts with a #. In this case, the line just
  129. signifies that this script is intended for use when connecting to Demon
  130. Internet Services, in this case using the SLIP protocols. Comments can be
  131. freely distributed throughout the script.
  132.  
  133. retry 5 5 10
  134. Set the connection retry system so that connection is attempted five times.
  135. The delay between the first and second attempts is five seconds, after which
  136. it tries at 10 second intervals. 
  137.  
  138. NewsRetry 50
  139. Sets the connection retry system to attempt up to 50 retries when contacting
  140. the USENET News server.
  141.  
  142. *rmensure slip 2.07 rmload System:Modules.Network.SLIP
  143. *rmensure slip 2.07 Error Slip version 2.07 or later is required
  144. These lines ensure that the correct version of the SLIP driver is loaded.
  145. If you are using the PPP driver, replace these lines with:
  146.  
  147. *rmensure PPP 1.02 rmload System:Modules.Network.PPP
  148. *rmensure PPP 1.02 Error PPP version 1.02 or later is required
  149.  
  150. +ifconfig -e sl0 down
  151. This switches the SLIP driver off; all transactions which take place between
  152. this line of the script and a line containing ifconfig -e sl0 up take place
  153. using "ordinary" V.nn modem protocols and flow control. The PPP driver
  154. initialises in a switched-off state, so this line can be omitted in the case
  155. of PPP being used. The use of a "+" as opposed to a "*" to prefix the
  156. command signifies that, if the command should fail to execute successfully,
  157. it should fail silently and hence allow the login script to continue
  158. executing rather than aborting and reporting an error.
  159.  
  160. SerialSetup
  161. This initialises the serial port to the appropriate baud rate, word length,
  162. parity etc.
  163.  
  164. Timeout 10
  165. This is used by the Wait command; a Wait is now configured to time out
  166. (reporting an error, terminating the script and closing the serial
  167. connection) 10 seconds after it is encountered.
  168.  
  169. Abort Busy
  170. Abort Carrier
  171. Abort incorrect
  172. Abort tone
  173. If any of the strings following "Abort" are sent to the computer by the
  174. modem during the next phase of establishing the connection, the script will
  175. close the connection to the modem and terminate.
  176.  
  177. Echo
  178. Tells the system to start copying incoming data to its logging system.
  179.  
  180. Send ATZ
  181. Sends the Hayes command string to the modem to reset it to its default
  182. configuration.
  183.  
  184. Wait OK
  185. Pauses until the string "OK" is sent to the computer by the modem, or
  186. generates an error, closes the connection and terminates the script if "OK"
  187. is not received before 10 seconds have elapsed.
  188.  
  189. Init
  190. Sends the configured initialisation string to the modem.
  191.  
  192. Wait OK
  193. As above.
  194.  
  195. Timeout 120
  196. Dial
  197. Resets the Wait timeout to 120 seconds, and uses the configured dialling
  198. method to contact the Service Provider.
  199.  
  200. Wait ogin:
  201. Waits until the string "ogin:" is received, or until 120 seconds have
  202. elapsed. As the "L" at the front of "Login:" varies from upper to lower case
  203. between service providers (and occasionally between PoPs run by the same
  204. service provider), it has been omitted from the test.
  205.  
  206. Timeout 60
  207. Login
  208. Modified the timeout period again, and sends the configured login name
  209. terminated by a carriage return.
  210.  
  211. Wait assword:
  212. Password
  213. Waits for the tail end of the "Password:" prompt from the Service Provider,
  214. and sends the configured password in response.
  215.  
  216. Wait ocol:
  217. Send idle=120,SLIP
  218. This is a part of the connection dialogue which appears to be operational
  219. for a number of Service Providers, although the inclusion of the "idle"
  220. response seems unique to Demon Internet Services; the Service Provider
  221. requests details of the protocol you will be running once your full IP
  222. connection is brought up. "ocol:" is the tail-end of Demon's "Protocol:"
  223. query; everything following the "Send" in the line below it is sent verbatim
  224. in response. If you were using the PPP driver you would have the line: Send
  225. idle=120,PPP instead. You may also wish to "fine-tune" the timeout value.
  226.  
  227. Wait ddress:
  228. GetIP
  229. This operation will, if dynamic IP allocation is enabled, configure your
  230. machine to use the IP address returned for this session by the Service
  231. Provider (see below); otherwise, if you have a static IP address, it will be
  232. ignored.
  233.  
  234. Wait HELLO
  235. In the case of Demon Internet Services, "HELLO" signifies that the logon and
  236. configuration procedure is complete; from here on, data sent to you by the
  237. Service Provider will comprise SLIP packets. Your own Service Provider may
  238. use a different string; check the documentation accompanying your contract
  239. with them for details.
  240.  
  241. Config sl0 
  242. This sets up the broadcast address, netmask etc which will be used by the
  243. SLIP interface during the session
  244.  
  245. +ifconfig -e sl0 up
  246. This line activates the SLIP driver, bringing you fully online.
  247.  
  248. Route
  249. This sets up the IP routing system between you and your Service Provider,
  250. taking into account which PoP you are using and which modem you are
  251. connected to at that PoP automatically.
  252.  
  253. If you are using the PPP driver you can ignore the above three commands.
  254. Instead you need to replace then with the following two lines.
  255.  
  256. *pppconnect InternalPC 0 noipdefault defaultroute crtscts modem asyncmap 0
  257. getifaddr ppp0
  258.  
  259. This tells the PPP module to connect to the device "InternalPC" (which is
  260. the internal serial port using a standard PC cable to connect to the modem)
  261. using the speed already defined on the serial port, setting up all that is
  262. needed automatically. If you are using an Acorn-style cable (as described in
  263. Application Note 234, and intended for use with systems fitted with 6551
  264. serial controller ICs) "InternalPC" should be replaced with "Internal". For
  265. external and third party high speed serial adaptors, details of the
  266. appropriate interface name should be supplied with the interface. Your modem
  267. must be configured to use RTS/CTS, to hang up when DTR is dropped and to
  268. make DCD follow the state of the line.
  269.  
  270. The remaining parameters used by *pppconnect are detailed, along with all
  271. other *pppconnect options, in the pppconnect for RISC OS man page (Appendix
  272. B).
  273.  
  274. Writing your Own Scripts
  275. ------------------------
  276. The script above is designed to work with Points of Presence (PoPs) run by
  277. Demon Internet Services; if you are using a different Service Provider, you
  278. may well find that the detail of the logon procedure differs from the one
  279. above, or you may have to re-tune your timeout thresholds. Up to the point
  280. where the Service Provider is dialled, however, it should be possible to
  281. duplicate the script "as is" depending upon the reaction of your modem to
  282. standard Hayes commands.
  283.  
  284. The details supplied by your Service Provider when you commence your
  285. contract with them should provide sufficient information to write a script
  286. which will operate with their logon procedures, however tuning the timeouts
  287. can be a fine art and is best judged by experience.
  288.  
  289. Handling Dynamic IP Allocation
  290. ------------------------------
  291. InterTalk is capable of handling the dynamic IP address allocation systems
  292. used by some Service Providers; if the IP address in the configuration file
  293. is left blank or set to Auto, the insertion of GetIP at the appropriate
  294. point in the auto-logon script will enable the IP address of your machine to
  295. be configured according to the dotted decimal IP address sent by the Service
  296. Provider.
  297.  
  298. If the IP address in the configuration file was left blank, the new IP
  299. address as returned by the service provider is put in the appropriate field
  300. in the configuration file and the file is then re-saved.
  301.  
  302. If the IP address field in the configuration file contains the string
  303. "Auto",  the IP address returned by the Service Provider is used for the
  304. duration of the session, but the contents of the configuration file are not
  305. altered.
  306.  
  307. If the IP address in the configuration file already has an IP address in it,
  308. the GetIP command is ignored.
  309.  
  310. Appendix A: Scripting Language Command Set
  311. ------------------------------------------
  312. Abort
  313. Syntax: Abort <string>
  314. This adds the specified string to the list of abort strings. If any string
  315. in this list is received from the service provider, the script is aborted
  316. with the error "Script aborted (<string>)". InterTalk will then try to
  317. re-establish the connection to the service provider, in accordance with the
  318. parameters passed to the Retry command (q.v.)
  319.  
  320. Config
  321. Syntax: Config <interface>
  322. Configures the named interface as a machine-to-provider link connecting the
  323. configured IP address with the configured gateway.
  324.  
  325. Dial
  326. Syntax: Dial
  327. Send either ATDT or ATDP (Hayes modem commands for tone and pulse dialling
  328. respectively) to the modem, depending on the configured dial method,
  329. followed by the configured telephone number.
  330.  
  331. Echo
  332. Syntax: Echo
  333. Sets the server to echo incoming data to the server log.
  334.  
  335. GetIFAddr
  336. Syntax: GetIFAddr <interface>
  337. Attempts to determine the IP address of the interface when using dynamic IP
  338. allocation. The command waits for five seconds, during which time the remote
  339. system should reply with the address; if this does not happen, the command
  340. times out, generating an error and aborting the logon script.
  341.  
  342. GetIP
  343. Syntax: GetIP
  344. If the IP address in the configuration file is left blank or set to Auto,
  345. this command looks in the input from the service provider for an IP address
  346. and configures it as the IP address to use for the local machine (giving the
  347. functionality of dynamic IP allocation).
  348.  
  349. If the IP address in the configuration file was left blank, the new IP
  350. address as returned by the service provider is put in the appropriate field
  351. in the configuration file and the file is then re-saved.
  352.  
  353. If the IP address in the configuration file already has an IP address in it,
  354. the GetIP command is ignored.
  355.  
  356. Hangup
  357. Syntax: Hangup
  358. This command waits for one second, then sends "+++" to the modem, followed
  359. by another one second pause. It then sends the configured hangup string to
  360. the modem.
  361.  
  362. Init
  363. Syntax: Init
  364. This command sends the configured init string to the modem.
  365.  
  366. Login
  367. Syntax: Login
  368. This command sends the configured local system name to the service provider,
  369. followed by a carriage return.
  370.  
  371. NewsRetry
  372. Syntax: NewsRetry <n>
  373. Sets the number of retries to use when attempting to connect to the USENET
  374. News server.
  375.  
  376. NoEcho
  377. Syntax: NoEcho
  378. Stops the server from echoing incoming data in the system log.
  379.  
  380. OS Command
  381. Syntax: *<command>
  382. Passes a command to the RISC OS Supervisor for execution.
  383.  
  384. Password
  385. Syntax: Password
  386. Sends the configured password followed by a carriage return.
  387.  
  388. Retry
  389. Syntax: Retry x y z
  390. Sets the number of times the system attempts to make a connection to the
  391. service provider.
  392.  
  393. x = number of times to retry before failure
  394. y = time in seconds between first and second attempts
  395. z = time in seconds between second and subsequent attempts
  396.  
  397. Route
  398. Syntax: Route
  399. Sets a default IP route through the configured gateway address.
  400.  
  401. Send
  402. Syntax: Send <string>
  403. Sends the attached string to the modem, terminated by a carriage return.
  404.  
  405. SerialSetup
  406. Syntax: SerialSetup
  407. Configures the serial port to match the configured setup parameters.
  408.  
  409. Timeout
  410. Syntax: Timeout <n>
  411. Sets the delay in seconds to n before a wait times out.
  412.  
  413. Wait
  414. Syntax: Wait <string>
  415. Waits for string to be received from the service provider. The string is
  416. case insensitive. If the string is not received within the time set by the
  417. Timeout command (q.v.) the script will terminate with the error "Script
  418. timed out."
  419.  
  420. Appendix B: pppconnect for RISC OS
  421. ----------------------------------
  422. SYNOPSIS
  423.  *PPPConnect [<driver>[:<port>]] [speed] [options]
  424.  
  425. DESCRIPTION
  426.  The Point-to-Point Protocol (PPP) provides a method for transmitting
  427. datagrams over serial point-to-point links. PPP is composed of three parts:
  428. a method for encapsulating datagrams over serial links, an extensible Link
  429. Control Protocol (LCP), and a family of Network Control Protocols (NCP) for
  430. establishing and configuring different network-layer protocols.
  431.  
  432.  The encapsulation scheme is provided by driver code in the kernel. pppd
  433. provides the basic LCP, authentication support, and an NCP for establishing
  434. and configuring the Internet Protocol (IP) (called the IP Control Protocol,
  435. IPCP).
  436.  
  437. FREQUENTLY USED OPTIONS
  438.      <driver>[:<port>]
  439.  Load the named blockdriver from SerialDev:Modules, and use the given port
  440. for communication. If this is not specified, the previously used driver will
  441. be used. The PPP module contains the Internal driver, which will be used if
  442. this option is never specified.
  443.  
  444.      <speed>
  445.  Set the baud rate to <speed>. The available speeds depend on the device you
  446. are using. If not specified, it will use the current setting of the chosen
  447. driver.
  448.  
  449.      asyncmap <map>
  450.   Set the async character map to <map>.  This map describes which control
  451. characters cannot be successfully received over the serial line.  PPP will
  452. ask the peer to send these characters as a 2-byte escape sequence.  The
  453. argument is a 32 bit hex number with each bit representing a character to
  454. escape. Bit 0 (00000001) represents the character 0x00; bit 31 (80000000)
  455. represents the character 0x1f or ^_.  If multiple asyncmap options are
  456. given, the values are ORed together.  If no asyncmap option is given, no
  457. async character map will be negotiated for the receive direction; the peer
  458. will then escape all control characters.
  459.  
  460.      auth 
  461.  Require the peer to authenticate itself before allowing network packets to
  462. be sent or received.
  463.  
  464.      crtscts
  465.  Use hardware flow control (i.e. RTS/CTS) to control the flow of data on the
  466. serial port.
  467.  
  468.      xonxoff
  469.  Use software flow control (i.e. XON/XOFF) to control the flow of data on
  470. the serial port. If neither this option nor the previous is used, the
  471. current state of the driver will be used
  472.  
  473.      -crtscts
  474.  A synonym for xonxoff.
  475.  
  476.      defaultroute
  477.  Add a default route to the system routing tables, using the peer as the
  478. gateway, when IPCP negotiation is successfully completed.  This entry is
  479. removed when the PPP connection is broken.
  480.  
  481.      escape xx,yy,...
  482.   Specifies that certain characters should be escaped on transmission
  483. (regardless of whether the peer requests them to be escaped with its async
  484. control character map).  The characters to be escaped are specified as a
  485. list of hex numbers separated by commas.  Note that almost any character can
  486. be specified for the escape option, unlike the asyncmap option which only
  487. allows control characters to be specified.  The characters which may not be
  488. escaped are those with hex values 0x20 - 0x3f or 0x5e.
  489.  
  490.      file <f>
  491.   Read options from file <f> (the format is described below).
  492.  
  493.      mru <n>
  494.  Set the MRU [Maximum Receive Unit] value to <n> for negotiation.  pppd will
  495. ask the peer to send packets of no more than <n> bytes.  The minimum MRU
  496. value is 128. The default MRU value is 1500.  A value of 296 is recommended
  497. for slow links (40 bytes for TCP/IP header + 256 bytes of data).
  498.  
  499.      netmask <n>
  500.  Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
  501. notation (e.g. 255.255.255.0).
  502.  
  503.      passive
  504.   Enables the "passive" option in the LCP.  With this option, pppd will
  505. attempt to initiate a connection; if no reply is received from the peer,
  506. pppd will then just wait passively for a valid LCP packet from the peer 
  507. (instead of exiting, as it does without this option).
  508.  
  509.      silent
  510.   With this option, pppd will not transmit LCP packets to initiate a
  511. connection until a valid LCP packet is received from the peer (as for the
  512. "passive" option with old versions of pppd).
  513.  
  514. OPTIONS
  515.      <local_IP_address>:<remote_IP_address>
  516.  Set the local and/or remote interface IP addresses. Either one may be
  517. omitted.  The IP addresses can be specified with a host name or in decimal
  518. dot notation (e.g. 150.234.56.78).  The default local address is the (first)
  519. IP address of the system (unless the noipdefault option is given).  The
  520. remote address will be obtained from the peer if not specified in any
  521. option. Thus, in simple cases, this option is not required.  If  a local
  522. and/or remote IP address is specified with this option, pppd will not accept
  523. a different value from the peer in the IPCP negotiation, unless the
  524. ipcp-accept-local and/or ipcp-accept-remote options are given, respectively.
  525.  
  526.  
  527.  
  528.  
  529.  
  530.      -all 
  531.  Don't request or allow negotiation of any options for LCP and IPCP (use
  532. default values).
  533.  
  534.      -ac  
  535.  Disable Address/Control compression negotiation (use default, i.e. 
  536. address/control field disabled).
  537.  
  538.      -am  
  539.  Disable asyncmap negotiation (use the default asyncmap, i.e. escape all
  540. control characters)
  541.  
  542.      -as <n>
  543.   Same as asyncmap <n>
  544.  
  545.      -ip  
  546.  Disable IP address negotiation (with this option, the remote IP address
  547. must be specified with an option on the command line or in an options file).
  548.  
  549.      -mn  
  550.  Disable magic number negotiation.  With this option, pppd cannot detect a
  551. looped-back line.
  552.  
  553.      -mru 
  554.  Disable MRU [Maximum Receive Unit] negotiation (use default, i.e. 1500).
  555.  
  556.      -p   
  557.  Same as the passive option.
  558.  
  559.      -pc  
  560.  Disable protocol field compression negotiation (use default, i.e.  protocol
  561. field compression disabled).
  562.  
  563.      +ua <p>
  564.  Agree to authenticate using PAP [Password Authentication Protocol] if
  565. requested by the peer, and use the data in file <p> for the user and
  566. password to send to the peer. The file contains the remote user name,
  567. followed by a newline, followed by the remote password, followed by a
  568. newline. This option is obsolescent.
  569.  
  570.      +pap 
  571.  Require the peer to authenticate itself using PAP.
  572.  
  573.      -pap
  574.   Don't agree to authenticate using PAP.
  575.  
  576.      +chap
  577.   Require the peer to authenticate itself using CHAP [Cryptographic
  578. Handshake Authentication Protocol] authentication.
  579.  
  580.      -chap
  581.   Don't agree to authenticate using CHAP.
  582.  
  583.      -vj  
  584.  Disable negotiation of Van Jacobson style IP header compression. This is
  585. the default above line speeds of 19200 baud, as Van Jacobson suffers from
  586. diminishing returns at high line speeds, and can be badly affected by a poor
  587. link. The main aim of VJ compression is to improve responsiveness of
  588. interactive traffic, eg typing via Telnet, over slow lines. It will not
  589. generally speed up file  transfers, such as FTP.
  590.  
  591.      +vj  
  592.  Enable negotiation of Van Jacobson stype IP header compression. This is the
  593. default at line speeds of 19200 baud or below.
  594.  
  595.  
  596.      domain <d>
  597.  Append the domain name <d> to the local host name for authentication
  598. purposes.  For example, if gethostname() returns the name porsche, but the
  599. fully qualified domain name is porsche.Quotron.COM, you would use the domain
  600. option to set the domain name to Quotron.COM
  601.  
  602.     modem
  603.   Use the modem control lines, ie signal to the modem using DTR, and check
  604. for hang-ups via DCD.
  605.  
  606.      local
  607.   Don't use the modem control lines.
  608.  
  609.      mtu <n>
  610.   Set the MTU [Maximum Transmit Unit] value to <n>. Unless the peer requests
  611. a smaller value via MRU negotiation, pppd will request that the kernel
  612. networking code send data packets of no more than n bytes through the PPP
  613. network interface.
  614.  
  615.      name <n>
  616.   Set the name of the local system for authentication purposes to <n>.
  617.  
  618.      user <u>
  619.   Set the user name to use for authenticating this machine with the peer
  620. using PAP to <u>.
  621.  
  622.      usehostname
  623.   Enforce the use of the hostname as the name of the local system for
  624. authentication purposes (overrides the name option).
  625.  
  626.      remotename <n>
  627.   Set the assumed name of the remote system for authentication purposes to
  628. <n>.
  629.  
  630.      noipdefault
  631.   Disables the default behaviour when no local IP address is specified,
  632. which is to determine (if possible) the local IP address from the hostname. 
  633. With this option, the peer will have to supply the local IP address during
  634. IPCP negotiation (unless it specified explicitly on the command line or in
  635. an options file).
  636.  
  637.      lcp-echo-interval <n>
  638.   If this option is given, pppd will send an LCP echo-request frame to the
  639. peer every n seconds.  Under Linux, the echo-request is sent when no packets
  640. have been received from the peer for n seconds.  Normally the peer should
  641. respond to the echo-request by sending an echo-reply.  This option can be
  642. used with the lcp-echo-failure option to detect that the peer is no longer
  643. connected.
  644.  
  645.      lcp-echo-failure <n>
  646.   If this option is given, pppd will presume the peer to be dead if n LCP
  647. echo-requests are sent without receiving a valid LCP echo-reply.  If this
  648. happens, pppd will terminate the connection.  Use of this option requires a
  649. non-zero value for the lcp-echo-interval parameter. This option can be used
  650. to enable pppd to terminate after the physical connection has been broken
  651. (e.g., the modem has hung up) in situations where no hardware modem control
  652. lines are available.
  653.  
  654.  
  655.  
  656.      lcp-restart <n>
  657.   Set the LCP restart interval (retransmission timeout) to <n> seconds
  658. (default 3).
  659.  
  660.      lcp-max-terminate <n>
  661.   Set the maximum number of LCP terminate-request transmissions to <n>
  662. (default 3).
  663.  
  664.      lcp-max-configure <n>
  665.    Set the maximum number of LCP configure-request transmissions to <n>
  666. (default 10).
  667.  
  668.      lcp-max-failure <n>
  669.  Set the maximum number of LCP configure-NAKs returned before starting to
  670. send configure-Rejects instead to <n> (default 10).
  671.  
  672.      ipcp-restart <n>
  673.   Set the IPCP restart interval (retransmission timeout) to <n> seconds
  674. (default 3).
  675.  
  676.      ipcp-max-terminate <n>
  677.   Set the maximum number of IPCP terminate-request transmissions to <n>
  678. (default 3).
  679.  
  680.      ipcp-max-configure <n>
  681.    Set the maximum number of IPCP configure-request transmissions to <n>
  682. (default 10).
  683.  
  684.      ipcp-max-failure <n>
  685.   Set the maximum number of IPCP configure-NAKs returned before starting to
  686. send configure-Rejects instead to<n> (default 10).
  687.  
  688.      pap-restart <n>
  689.    Set the PAP restart interval (retransmission timeout) to <n> seconds
  690. (default 3).
  691.  
  692.      pap-max-authreq <n>
  693.    Set the maximum number of PAP authenticate-request transmissions to <n>
  694. (default 10).
  695.  
  696.      chap-restart <n>
  697.    Set the CHAP restart interval (retransmission timeout for challenges) to
  698. <n> seconds (default 3).
  699.  
  700.      chap-max-challenge <n>
  701.    Set the maximum number of CHAP challenge transmissions to <n> (default
  702. 10).
  703.  
  704.      chap-interval <n>
  705.    If this option is given, pppd will rechallenge the peer every <n>
  706. seconds.
  707.  
  708.      ipcp-accept-local
  709.   With this option, pppd will accept the peer's idea of our local IP
  710. address, even if the local IP address was specified in an option.
  711.  
  712.      ipcp-accept-remote
  713.  With this option, pppd will accept the peer's idea of its (remote) IP
  714. address, even if the remote IP address was specified in an option.
  715.  
  716. OPTIONS FILES
  717.      Options can be taken from files as well as the command line. PPP reads
  718. options from the files InetDbase:PPP.options before looking at the command
  719. line.  An options file is parsed into a series of words, delimited by
  720. whitespace.  Whitespace can be included in a word by enclosing the word in
  721. quotes ("). A backslash (\) quotes the following character.  A hash (#
  722. starts a comment, which continues until the end of the line.
  723.  
  724. AUTHENTICATION
  725.      PPP provides system administrators with sufficient access control that
  726. PPP access to a server machine can be provided to legitimate users without
  727. fear of compromising the security of the server or the network it's on.  In
  728. part this is provided by the InetDbase:PPP.options file, where the
  729. administrator can place options to require authenticationwhenever PPP is
  730. run, and in part by the PAP and CHAP secrets files, where the administrator
  731. can restrict the set of IP addresses which individual users may use.
  732.  
  733.  The default behaviour of PPP is to agree to authenticate if requested, and
  734. to not require authentication from the peer. However, PPP will not agree to
  735. authenticate itself with a particular protocol if it has no secrets which
  736. could be used to do so.
  737.  
  738.  Authentication is based on secrets, which are selected from secrets files
  739. (InetDBase:PPP.PAPSecrets for PAP, InetDBase:PPP.CHAPSecret for CHAP).  Both
  740. secrets files have the same format, and both can store secrets for several
  741. combinations of server (authenticating peer) and client (peer being
  742. authenticated).  Note that pppd can be both a server and client, and that
  743. different protocols can be used in the two directions if desired.
  744.  
  745.  A secrets file is parsed into words as for a options file. A secret is
  746. specified by a line containing at least 3 words, in the order client,
  747. server, secret.  Any following words on the same line are taken to be a list
  748. of acceptable IP addresses for that client.  If there are only 3 words on
  749. the line, it is assumed that any IP address is OK; to disallow all IP
  750. addresses, use "-".  If the secret starts with an `@', what follows is
  751. assumed to be the name of a file from which to read the secret.  A "*" as
  752. the client or server name matches any name.  When selecting a secret, pppd
  753. takes the best match, i.e.  the match with the fewest wildcards.
  754.  
  755.  Thus a secrets file contains both secrets for use in authenticating other
  756. hosts, plus secrets which we use for authenticating ourselves to others. 
  757. Which secret to use is chosen based on the names of the host (the `local
  758. name') and its peer (the `remote name').  The local name is set as follows:
  759.  
  760.     if the usehostname option is given, then the local name is the hostname
  761.     of this machine (with the domain appended, if given)
  762.  
  763.     else if the name option is given, then use the argument of the first
  764.     name option seen
  765.  
  766.     else if the local IP address is specified with a hostname, then use that
  767.     name
  768.         
  769.     else use the hostname of this machine (with the domain appended, if
  770.     given)
  771.         
  772.  When authenticating ourselves using PAP, there is also a `username' which
  773. is the local name by default, but can be set with the user option or the +ua
  774. option.
  775.  
  776.  The remote name is set as follows:
  777.  
  778.     if the remotename option is given, then use the argument of the last
  779.     remotename option seen
  780.  
  781.     else if the remote IP address is specified with a hostname, then use
  782.     that host name
  783.  
  784.     else the remote name is the null string "".
  785.  
  786.  Secrets are selected from the PAP secrets file as follows:
  787.  
  788.   * For authenticating the peer, look for a secret with client == username
  789.     specified in the PAP authenticate-request, and server == local name.
  790.  
  791.   * For authenticating ourselves to the peer, look for a secret with client
  792.     == our username, server == remote name.
  793.  
  794.      When authenticating the peer with PAP, a secret of "" matches any
  795. password supplied by the peer.  If the password doesn't match the secret,
  796. the password is encrypted using crypt() and checked against the secret
  797. again; thus secrets for authenticating the peer can be stored in encrypted
  798. form. Thus, the system administrator can set up the PAP secrets file to
  799. allow PPP access only to certain users, and to restrict the set of IP
  800. addresses that each user can use.
  801.  
  802.  Secrets are selected from the CHAP secrets file as follows:
  803.  
  804.      * For authenticating the peer, look for a secret with client == name
  805.        specified in the CHAP-Response message, and server == local name.
  806.  
  807.      * For authenticating ourselves to the peer, look for a secret with
  808.        client == local name, and server == name specified in the
  809.        CHAP-Challenge message.
  810.  
  811.  Authentication must be satisfactorily completed before IPCP (or any other
  812. Network Control Protocol) can be started.  If authentication fails, pppd
  813. will terminated the link (by closing LCP).  If IPCP negotiates an
  814. unacceptable IP address for the remote host, IPCP will be closed.  IP
  815. packets can only be sent or received when IPCP is open.
  816.  
  817.  In some cases it is desirable to allow some hosts which can't authenticate
  818. themselves to connect and use one of a restricted set of IP addresses, even
  819. when the local host generally requires authentication.  If the peer refuses
  820. to authenticate itself when requested, pppd takes that as equivalent to
  821. authenticating with PAP using the empty string for the username and
  822. password.  Thus, by adding a line to the pap-secrets file which specifies
  823. the empty string for the client and password, it is possible to allow
  824. restricted access to hosts which refuse to authenticate themselves.
  825.  
  826. ROUTING
  827.  When IPCP negotiation is completed successfully, pppd will inform the
  828. kernel of the local and remote IP addresses for the ppp interface.  This is
  829. sufficient to create a host route to the remote end of the link, which will
  830. enable the peers to exchange IP packets.  Communication with other machines
  831. generally requires further modification to routing tables and/or ARP
  832. (Address Resolution Protocol) tables.  In some cases this will be done
  833. automatically through the actions of the routed or gated daemons, but in
  834. most cases some further intervention is required.
  835.  
  836.  Sometimes it is desirable to add a default route through the remote host,
  837. as in the case of a machine whose only connection to the Internet is through
  838. the ppp interface.  The defaultroute option causes PPP to create such a
  839. default route when IPCP comes up, and delete it when the link is terminated.
  840.  
  841.  In some cases it is desirable to use proxy ARP, for example on a server
  842. machine connected to a LAN, in order to allow other hosts to communicate
  843. with the remote host.  The proxy-arp option causes pppd to look for a
  844. network interface on the same subnet as the remote host (an interface
  845. supporting broadcast and ARP, which is up and not a point-to-point or
  846. loopback interface).  If found, PPP creates a permanent, published ARP entry
  847. with the IP address of the remote host and the hardware address of the
  848. network interface found. (Not implemented yet)
  849.  
  850. EXAMPLES
  851.      In the simplest case, you can connect the serial ports of two machines
  852. and issue a command like
  853.  
  854.  *PPPConnect InternalPC 9600 passive
  855.  
  856.  If you are using a modem, you will need to run a dialler, such as Chat, to
  857. make the initial connection.
  858.     
  859.  If your serial connection is any more complicated than a piece of wire, you
  860. may need to arrange for some control characters to be escaped.  In
  861. particular, it is often useful to escape XON (^Q) and XOFF (^S), using
  862. asyncmap a0000.
  863.      
  864.  If you need to authenticate yourself to the remote end, using PAP, you
  865. would use a command like
  866.      
  867.  *PPPConnect 115200 user m.jones              
  868.  
  869. and have a line in your PAP secrets file     
  870.  
  871.  m.jones * abcdefg
  872.      
  873. meaning that user m.jones should be authenticated to any host with the password abcdefg.
  874.      
  875. To close the link, issue the command
  876.            
  877.  *PPPDisconnect
  878.  
  879. DIAGNOSTICS
  880.      The contents of all control packets sent or received are logged, that
  881. is, all LCP, PAP, CHAP or IPCP packets.  This can be useful if the PPP
  882. negotiation  does not succeed. The log can be displayed using the *PPPLog
  883. command.
  884.  
  885. The *PPPInfo command provides standard network driver statistics.
  886.  
  887. FILES
  888.      InetDBase:PPP.IP-Up
  889.  A program or script which is executed when the link is available for
  890. sending and receiving IP packets (that is, IPCP has come up).  It is
  891. executed with the parameters interface-name driver speed local-IP-address
  892. remote-IP-address.
  893.  
  894.  This file is restricted in what it can do. In particular it should not
  895. start a new application (eg running ifconfig).
  896.           
  897.      InetDBase:PPP.IP-Down
  898.  A program or script which is executed when the link is no longer available
  899. for sending and receiving IP packets.  This script can be used for undoing
  900. the effects of the InetDBase:PPP.IP-Up script.  It is invoked with the same
  901. parameters as the ip-up script. The same restrictions apply.
  902.  
  903.  
  904.      InetDBase:PPP.PAPSecrets
  905.  Usernames, passwords and IP addresses for PAP authentication.
  906.  
  907.      InetDBase:PPP.CHAPSecret
  908.  Names, secrets and IP addresses for CHAP authentication.
  909.  
  910.      InetDBase:PPP.Options
  911.  System default options for PPP, read before command-line options.
  912.  
  913. NOTES
  914.  If you wish to check the state of the PPP connection from an
  915. application, there are two things you need to check.
  916.  
  917. Using socketioctl(SIOCGIFFLAGS) will tell you whether the IP layer is
  918. up (the IFF_UP flags). To tell whether the PPP daemon is actually active you
  919. will need to use the PPP_Stats SWI to examine the running flag; the
  920. IFF_RUNNING flag from the socketioctl does not correctly indicate the state
  921. of the daemon.
  922.      
  923. SEE ALSO
  924.      RFC1144
  925.           Jacobson, V.  Compressing TCP/IP headers for low-speed serial 1990
  926.           February.
  927.  
  928.      RFC1321
  929.           Rivest, R.  The MD5 Message-Digest Algorithm. 1992 April.
  930.  
  931.      RFC1332
  932.           McGregor, G.  PPP Internet Protocol Control Protocol (IPCP).  1992
  933.           May.
  934.  
  935.      RFC1334
  936.           Lloyd, B.; Simpson, W.A.  PPP authentication protocols.1992
  937.           October.
  938.  
  939.      RFC1548
  940.           Simpson, W.A.  The Point-to-Point Protocol (PPP). 1993 December.
  941.  
  942.      RFC1549
  943.           Simpson, W.A.  PPP in HDLC Framing. 1993 December
  944.  
  945. AUTHORS
  946.      Drew Perkins, Brad Clements, Karl Fox, Greg Christy, Brad Parker
  947. (brad@fcr.com), Paul Mackerras (paulus@cs.anu.edu.au), Kevin Bracey
  948.  
  949.  
  950.